package com.erp.framework.types;

import java.sql.Date;

import com.erp.framework.SimpleConstants;

public class CustomSqlDate extends Date implements SimpleConstants {

    /**
     * @param date
     */
    public CustomSqlDate(long date){
        super(date);
    }
    
    /**
     * @param date
     */
    public CustomSqlDate(java.util.Date date) {
        super(date.getTime());
    }
    
    /**
     * @param date
     */
    public CustomSqlDate(java.sql.Date date) {
        super(date.getTime());
    }

    /**
     * @param date
     */
    public CustomSqlDate(java.sql.Timestamp date) {
        super(date.getTime());
    }
    
    /**
     * @deprecated
     * @param year
     * @param month
     * @param day
     */
    public CustomSqlDate(int year, int month, int day) {
        super(year, month, day);
    }
    
    public static CustomSqlDate customize(java.util.Date date){
        if(date == null){
            return null;
        } else {
            return new CustomSqlDate(date);
        }
    }
    
    public static CustomSqlDate customize(java.sql.Date date){
        if(date == null){
            return null;
        } else {
            return new CustomSqlDate(date);
        }
    }
    
    public static CustomSqlDate customize(java.sql.Timestamp date){
        if(date == null){
            return null;
        } else {
            return new CustomSqlDate(date);
        }
    }
    
//    public String toString() {
////    	SimpleDateFormat formatter = new SimpleDateFormat(OUTPUT_DATE_FORMAT, DEFAULT_LOCALE);
////    	if(this == null){
////    		return "";
////    	} else {
////    		return formatter.format(this);
////    	}
//    	return super.toString();
//    }
}
